<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>1.3.9. Expressions &mdash; Pyslet 0.4.20140526 documentation</title>
    
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '0.4.20140526',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="Pyslet 0.4.20140526 documentation" href="../index.html" />
    <link rel="up" title="1.3. IMS Question and Test Interoperability (version 2.1)" href="../imsqtiv2p1.html" />
    <link rel="next" title="1.3.10. Core Types and Utilities" href="core.html" />
    <link rel="prev" title="1.3.6. Response Processing" href="processing.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="core.html" title="1.3.10. Core Types and Utilities"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="processing.html" title="1.3.6. Response Processing"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">Pyslet 0.4.20140526 documentation</a> &raquo;</li>
          <li><a href="../ims.html" >1. IMS Global Learning Consortium Specifications</a> &raquo;</li>
          <li><a href="../imsqtiv2p1.html" accesskey="U">1.3. IMS Question and Test Interoperability (version 2.1)</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-pyslet.qtiv2.expressions">
<span id="expressions"></span><h1>1.3.9. Expressions<a class="headerlink" href="#module-pyslet.qtiv2.expressions" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="pyslet.qtiv2.expressions.Expression">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Expression</tt><big>(</big><em>parent</em>, <em>name=None</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Expression" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="core.html#pyslet.qtiv2.core.QTIElement" title="pyslet.qtiv2.core.QTIElement"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.core.QTIElement</span></tt></a></p>
<p>Abstract class for all expression elements.</p>
<dl class="method">
<dt id="pyslet.qtiv2.expressions.Expression.Evaluate">
<tt class="descname">Evaluate</tt><big>(</big><em>state</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Expression.Evaluate" title="Permalink to this definition">¶</a></dt>
<dd><p>Evaluates this expression in the context of the session <em>state</em>.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.qtiv2.expressions.Expression.IntegerOrTemplateRef">
<tt class="descname">IntegerOrTemplateRef</tt><big>(</big><em>state</em>, <em>value</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Expression.IntegerOrTemplateRef" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a value of type integerOrTemplateRef this method returns the
corresponding integer by looking up the value, if necessary, in
<em>state</em>.  If value is a variable reference to a variable with NULL
value then None is returned.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.qtiv2.expressions.Expression.FloatOrTemplateRef">
<tt class="descname">FloatOrTemplateRef</tt><big>(</big><em>state</em>, <em>value</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Expression.FloatOrTemplateRef" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a value of type floatOrTemplateRef this method returns the
corresponding float by looking up the value, if necessary, in
<em>state</em>.  If value is a variable reference to a variable with NULL
value then None is returned.</p>
</dd></dl>

<dl class="method">
<dt id="pyslet.qtiv2.expressions.Expression.StringOrTemplateRef">
<tt class="descname">StringOrTemplateRef</tt><big>(</big><em>state</em>, <em>value</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Expression.StringOrTemplateRef" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a value of type stringOrTemplateRef this method returns the
corresponding string by looking up the value, if necessary, in
<em>state</em>.  If value is a variable reference to a variable with NULL
value then None is returned.  Note that unlike the integer and float
expansions this expansion will not raise an error if <em>value</em> is a
syntactically valid reference to a non-existent template variable, as
per this condition in the specification.</p>
<blockquote>
<div>&#8220;if a string attribute appears to be a reference to a template
variable but there is no variable with the given name it should be
treated simply as string value&#8221;</div></blockquote>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.NOperator">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">NOperator</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.NOperator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.Expression" title="pyslet.qtiv2.expressions.Expression"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.Expression</span></tt></a></p>
<p>An abstract class to help implement operators which take multiple sub-expressions.</p>
<dl class="method">
<dt id="pyslet.qtiv2.expressions.NOperator.EvaluateChildren">
<tt class="descname">EvaluateChildren</tt><big>(</big><em>state</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.NOperator.EvaluateChildren" title="Permalink to this definition">¶</a></dt>
<dd><p>Evaluates all child expressions, returning an iterable of
<tt class="xref py py-class docutils literal"><span class="pre">Value</span></tt> instances.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.UnaryOperator">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">UnaryOperator</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.UnaryOperator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.Expression" title="pyslet.qtiv2.expressions.Expression"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.Expression</span></tt></a></p>
<p>An abstract class to help implement unary operators.</p>
</dd></dl>

<div class="section" id="built-in-general-expressions">
<h2>1.3.9.1. Built-in General Expressions<a class="headerlink" href="#built-in-general-expressions" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyslet.qtiv2.expressions.BaseValue">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">BaseValue</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.BaseValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.Expression" title="pyslet.qtiv2.expressions.Expression"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.Expression</span></tt></a></p>
<p>The simplest expression returns a single value from the set defined by
the given baseType</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;baseValue.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;baseType&quot; type=&quot;baseType.Type&quot; use=&quot;required&quot;/&gt;
&lt;/xsd:attributeGroup&gt;

&lt;xsd:complexType name=&quot;baseValue.Type&quot;&gt;
        &lt;xsd:simpleContent&gt;
                &lt;xsd:extension base=&quot;xsd:string&quot;&gt;
                        &lt;xsd:attributeGroup ref=&quot;baseValue.AttrGroup&quot;/&gt;
                &lt;/xsd:extension&gt;
        &lt;/xsd:simpleContent&gt;
&lt;/xsd:complexType&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Variable">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Variable</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Variable" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.Expression" title="pyslet.qtiv2.expressions.Expression"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.Expression</span></tt></a></p>
<p>This expression looks up the value of an itemVariable that has been
declared in a corresponding variableDeclaration or is one of the built-in
variables:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;variable.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;identifier&quot; type=&quot;identifier.Type&quot; use=&quot;required&quot;/&gt;
        &lt;xsd:attribute name=&quot;weightIdentifier&quot; type=&quot;identifier.Type&quot; use=&quot;optional&quot;/&gt;
&lt;/xsd:attributeGroup&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Default">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Default</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Default" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.Expression" title="pyslet.qtiv2.expressions.Expression"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.Expression</span></tt></a></p>
<p>This expression looks up the declaration of an itemVariable and returns
the associated defaultValue or NULL if no default value was declared:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;default.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;identifier&quot; type=&quot;identifier.Type&quot; use=&quot;required&quot;/&gt;
&lt;/xsd:attributeGroup&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Correct">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Correct</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Correct" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.Expression" title="pyslet.qtiv2.expressions.Expression"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.Expression</span></tt></a></p>
<p>This expression looks up the declaration of a response variable and
returns the associated correctResponse or NULL if no correct value was
declared:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;correct.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;identifier&quot; type=&quot;identifier.Type&quot; use=&quot;required&quot;/&gt;
&lt;/xsd:attributeGroup&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.MapResponse">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">MapResponse</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.MapResponse" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.Expression" title="pyslet.qtiv2.expressions.Expression"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.Expression</span></tt></a></p>
<p>This expression looks up the value of a response variable and then
transforms it using the associated mapping, which must have been declared.
The result is a single float:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;mapResponse.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;identifier&quot; type=&quot;identifier.Type&quot; use=&quot;required&quot;/&gt;
&lt;/xsd:attributeGroup&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.MapResponsePoint">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">MapResponsePoint</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.MapResponsePoint" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.Expression" title="pyslet.qtiv2.expressions.Expression"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.Expression</span></tt></a></p>
<p>This expression looks up the value of a response variable that must be of
base-type point, and transforms it using the associated areaMapping:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;mapResponsePoint.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;identifier&quot; type=&quot;identifier.Type&quot; use=&quot;required&quot;/&gt;
&lt;/xsd:attributeGroup&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Null">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Null</tt><big>(</big><em>parent</em>, <em>name=None</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Null" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.Expression" title="pyslet.qtiv2.expressions.Expression"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.Expression</span></tt></a></p>
<p>null is a simple expression that returns the NULL value - the null value is
treated as if it is of any desired baseType</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:complexType name=&quot;null.Type&quot;/&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.RandomInteger">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">RandomInteger</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.RandomInteger" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.Expression" title="pyslet.qtiv2.expressions.Expression"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.Expression</span></tt></a></p>
<p>Selects a random integer from the specified range [min,max] satisfying
min + step * n for some integer n:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;randomInteger.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;min&quot; type=&quot;integerOrTemplateRef.Type&quot; use=&quot;required&quot;/&gt;
        &lt;xsd:attribute name=&quot;max&quot; type=&quot;integerOrTemplateRef.Type&quot; use=&quot;required&quot;/&gt;
        &lt;xsd:attribute name=&quot;step&quot; type=&quot;integerOrTemplateRef.Type&quot; use=&quot;optional&quot;/&gt;
&lt;/xsd:attributeGroup&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.RandomFloat">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">RandomFloat</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.RandomFloat" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.Expression" title="pyslet.qtiv2.expressions.Expression"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.Expression</span></tt></a></p>
<p>Selects a random float from the specified range [min,max]</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;randomFloat.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;min&quot; type=&quot;floatOrTemplateRef.Type&quot; use=&quot;required&quot;/&gt;
        &lt;xsd:attribute name=&quot;max&quot; type=&quot;floatOrTemplateRef.Type&quot; use=&quot;required&quot;/&gt;
&lt;/xsd:attributeGroup&gt;
</pre></div>
</div>
</dd></dl>

</div>
<div class="section" id="expressions-used-only-in-outcomes-processing">
<h2>1.3.9.2. Expressions Used only in Outcomes Processing<a class="headerlink" href="#expressions-used-only-in-outcomes-processing" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="operators">
<h2>1.3.9.3. Operators<a class="headerlink" href="#operators" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="pyslet.qtiv2.expressions.Multiple">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Multiple</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Multiple" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The multiple operator takes 0 or more sub-expressions all of which must
have either single or multiple cardinality:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;multiple.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Ordered">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Ordered</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Ordered" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The multiple operator takes 0 or more sub-expressions all of which must
have either single or multiple cardinality:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;ordered.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.ContainerSize">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">ContainerSize</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.ContainerSize" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.UnaryOperator" title="pyslet.qtiv2.expressions.UnaryOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.UnaryOperator</span></tt></a></p>
<p>The containerSize operator takes a sub-expression with any base-type and
either multiple or ordered cardinality:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;containerSize.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.IsNull">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">IsNull</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.IsNull" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.UnaryOperator" title="pyslet.qtiv2.expressions.UnaryOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.UnaryOperator</span></tt></a></p>
<p>The isNull operator takes a sub-expression with any base-type and
cardinality</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;isNull.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Index">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Index</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Index" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.UnaryOperator" title="pyslet.qtiv2.expressions.UnaryOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.UnaryOperator</span></tt></a></p>
<p>The index operator takes a sub-expression with an ordered container value
and any base-type</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;index.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;n&quot; type=&quot;integer.Type&quot; use=&quot;required&quot;/&gt;
&lt;/xsd:attributeGroup&gt;

&lt;xsd:group name=&quot;index.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.FieldValue">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">FieldValue</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.FieldValue" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.UnaryOperator" title="pyslet.qtiv2.expressions.UnaryOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.UnaryOperator</span></tt></a></p>
<p>The field-value operator takes a sub-expression with a record container
value. The result is the value of the field with the specified
fieldIdentifier:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;fieldValue.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;fieldIdentifier&quot; type=&quot;identifier.Type&quot; use=&quot;required&quot;/&gt;
&lt;/xsd:attributeGroup&gt;

&lt;xsd:group name=&quot;fieldValue.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Random">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Random</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Random" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.UnaryOperator" title="pyslet.qtiv2.expressions.UnaryOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.UnaryOperator</span></tt></a></p>
<p>The random operator takes a sub-expression with a multiple or ordered
container value and any base-type. The result is a single value randomly
selected from the container:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;random.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Member">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Member</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Member" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The member operator takes two sub-expressions which must both have the
same base-type. The first sub-expression must have single cardinality and
the second must be a multiple or ordered container. The result is a single
boolean with a value of true if the value given by the first sub-expression
is in the container defined by the second sub-expression:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;member.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Delete">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Delete</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Delete" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The delete operator takes two sub-expressions which must both have the
same base-type. The first sub-expression must have single cardinality and
the second must be a multiple or ordered container. The result is a new
container derived from the second sub-expression with all instances of the
first sub-expression removed:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;delete.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Contains">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Contains</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Contains" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The contains operator takes two sub-expressions which must both have the
same base-type and cardinality &#8211; either multiple or ordered. The result is
a single boolean with a value of true if the container given by the first
sub-expression contains the value given by the second sub-expression and
false if it doesn&#8217;t:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;contains.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.SubString">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">SubString</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.SubString" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The substring operator takes two sub-expressions which must both have an
effective base-type of string and single cardinality. The result is a single
boolean with a value of true if the first expression is a substring of the
second expression and false if it isn&#8217;t:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;substring.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;caseSensitive&quot; type=&quot;boolean.Type&quot; use=&quot;required&quot;/&gt;
&lt;/xsd:attributeGroup&gt;

&lt;xsd:group name=&quot;substring.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Not">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Not</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Not" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.UnaryOperator" title="pyslet.qtiv2.expressions.UnaryOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.UnaryOperator</span></tt></a></p>
<p>The not operator takes a single sub-expression with a base-type of
boolean and single cardinality. The result is a single boolean with a value
obtained by the logical negation of the sub-expression&#8217;s value:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;not.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.And">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">And</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.And" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The and operator takes one or more sub-expressions each with a base-type
of boolean and single cardinality. The result is a single boolean which is
true if all sub-expressions are true and false if any of them are false:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;and.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;unbounded&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Or">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Or</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Or" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The or operator takes one or more sub-expressions each with a base-type
of boolean and single cardinality. The result is a single boolean which is
true if any of the sub-expressions are true and false if all of them are
false:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;or.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;unbounded&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.AnyN">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">AnyN</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.AnyN" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The anyN operator takes one or more sub-expressions each with a base-type
of boolean and single cardinality. The result is a single boolean which is
true if at least min of the sub-expressions are true and at most max of the
sub-expressions are true:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;anyN.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;min&quot; type=&quot;integerOrTemplateRef.Type&quot; use=&quot;required&quot;/&gt;
        &lt;xsd:attribute name=&quot;max&quot; type=&quot;integerOrTemplateRef.Type&quot; use=&quot;required&quot;/&gt;
&lt;/xsd:attributeGroup&gt;

&lt;xsd:group name=&quot;anyN.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;unbounded&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Match">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Match</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Match" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The match operator takes two sub-expressions which must both have the
same base-type and cardinality. The result is a single boolean with a value
of true if the two expressions represent the same value and false if they do
not:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;match.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.StringMatch">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">StringMatch</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.StringMatch" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The stringMatch operator takes two sub-expressions which must have single
and a base-type of string. The result is a single boolean with a value of
true if the two strings match:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;stringMatch.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;caseSensitive&quot; type=&quot;boolean.Type&quot; use=&quot;required&quot;/&gt;
        &lt;xsd:attribute name=&quot;substring&quot; type=&quot;boolean.Type&quot; use=&quot;optional&quot;/&gt;
&lt;/xsd:attributeGroup&gt;

&lt;xsd:group name=&quot;stringMatch.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.PatternMatch">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">PatternMatch</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.PatternMatch" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.UnaryOperator" title="pyslet.qtiv2.expressions.UnaryOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.UnaryOperator</span></tt></a></p>
<p>The patternMatch operator takes a sub-expression which must have single
cardinality and a base-type of string. The result is a single boolean with a
value of true if the sub-expression matches the regular expression given by
pattern and false if it doesn&#8217;t:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;patternMatch.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;pattern&quot; type=&quot;stringOrTemplateRef.Type&quot; use=&quot;required&quot;/&gt;
&lt;/xsd:attributeGroup&gt;

&lt;xsd:group name=&quot;patternMatch.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Equal">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Equal</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Equal" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The equal operator takes two sub-expressions which must both have single
cardinality and have a numerical base-type. The result is a single boolean
with a value of true if the two expressions are numerically equal and false
if they are not:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;equal.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;toleranceMode&quot; type=&quot;toleranceMode.Type&quot; use=&quot;required&quot;/&gt;
        &lt;xsd:attribute name=&quot;tolerance&quot; use=&quot;optional&quot;&gt;
                &lt;xsd:simpleType&gt;
                        &lt;xsd:list itemType=&quot;floatOrTemplateRef.Type&quot;/&gt;
                &lt;/xsd:simpleType&gt;
        &lt;/xsd:attribute&gt;
        &lt;xsd:attribute name=&quot;includeLowerBound&quot; type=&quot;boolean.Type&quot; use=&quot;optional&quot;/&gt;
        &lt;xsd:attribute name=&quot;includeUpperBound&quot; type=&quot;boolean.Type&quot; use=&quot;optional&quot;/&gt;
&lt;/xsd:attributeGroup&gt;

&lt;xsd:group name=&quot;equal.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.ToleranceMode">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">ToleranceMode</tt><a class="headerlink" href="#pyslet.qtiv2.expressions.ToleranceMode" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="../xsdatatypes20041028.html#pyslet.xsdatatypes20041028.Enumeration" title="pyslet.xsdatatypes20041028.Enumeration"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.xsdatatypes20041028.Enumeration</span></tt></a></p>
<p>When comparing two floating point numbers for equality it is often
desirable to have a tolerance to ensure that spurious errors in scoring are
not introduced by rounding errors. The tolerance mode determines whether the
comparison is done exactly, using an absolute range or a relative range:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:simpleType name=&quot;toleranceMode.Type&quot;&gt;
        &lt;xsd:restriction base=&quot;xsd:NMTOKEN&quot;&gt;
                &lt;xsd:enumeration value=&quot;absolute&quot;/&gt;
                &lt;xsd:enumeration value=&quot;exact&quot;/&gt;
                &lt;xsd:enumeration value=&quot;relative&quot;/&gt;
        &lt;/xsd:restriction&gt;
&lt;/xsd:simpleType&gt;
</pre></div>
</div>
<p>Defines constants for the above modes.  Usage example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">ToleranceMode</span><span class="o">.</span><span class="n">exact</span>
</pre></div>
</div>
<p>The default value is exact:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">ToleranceMode</span><span class="o">.</span><span class="n">DEFAULT</span> <span class="o">==</span> <span class="n">ToleranceMode</span><span class="o">.</span><span class="n">exact</span>
</pre></div>
</div>
<p>For more methods see <a class="reference internal" href="../xsdatatypes20041028.html#pyslet.xsdatatypes20041028.Enumeration" title="pyslet.xsdatatypes20041028.Enumeration"><tt class="xref py py-class docutils literal"><span class="pre">Enumeration</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.EqualRounded">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">EqualRounded</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.EqualRounded" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The equalRounded operator takes two sub-expressions which must both have
single cardinality and have a numerical base-type. The result is a single
boolean with a value of true if the two expressions are numerically equal
after rounding and false if they are not:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;equalRounded.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;roundingMode&quot; type=&quot;roundingMode.Type&quot; use=&quot;required&quot;/&gt;
        &lt;xsd:attribute name=&quot;figures&quot; type=&quot;integerOrTemplateRef.Type&quot; use=&quot;required&quot;/&gt;
&lt;/xsd:attributeGroup&gt;

&lt;xsd:group name=&quot;equalRounded.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.RoundingMode">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">RoundingMode</tt><a class="headerlink" href="#pyslet.qtiv2.expressions.RoundingMode" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="../xsdatatypes20041028.html#pyslet.xsdatatypes20041028.Enumeration" title="pyslet.xsdatatypes20041028.Enumeration"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.xsdatatypes20041028.Enumeration</span></tt></a></p>
<p>Numbers are rounded to a given number of significantFigures or decimalPlaces:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:simpleType name=&quot;roundingMode.Type&quot;&gt;
        &lt;xsd:restriction base=&quot;xsd:NMTOKEN&quot;&gt;
                &lt;xsd:enumeration value=&quot;decimalPlaces&quot;/&gt;
                &lt;xsd:enumeration value=&quot;significantFigures&quot;/&gt;
        &lt;/xsd:restriction&gt;
&lt;/xsd:simpleType&gt;
</pre></div>
</div>
<p>Defines constants for the above modes.  Usage example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">RoundingMode</span><span class="o">.</span><span class="n">decimalPlaces</span>
</pre></div>
</div>
<p>The default value is significantFigures:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">RoundingMode</span><span class="o">.</span><span class="n">DEFAULT</span> <span class="o">==</span> <span class="n">RoundingMode</span><span class="o">.</span><span class="n">significantFigures</span>
</pre></div>
</div>
<p>For more methods see <a class="reference internal" href="../xsdatatypes20041028.html#pyslet.xsdatatypes20041028.Enumeration" title="pyslet.xsdatatypes20041028.Enumeration"><tt class="xref py py-class docutils literal"><span class="pre">Enumeration</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Inside">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Inside</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Inside" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.UnaryOperator" title="pyslet.qtiv2.expressions.UnaryOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.UnaryOperator</span></tt></a>, <tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.core.ShapeElementMixin</span></tt></p>
<p>The inside operator takes a single sub-expression which must have a
baseType of point. The result is a single boolean with a value of true if
the given point is inside the area defined by shape and coords. If the
sub-expression is a container the result is true if any of the points are
inside the area:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;inside.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;shape&quot; type=&quot;shape.Type&quot; use=&quot;required&quot;/&gt;
        &lt;xsd:attribute name=&quot;coords&quot; type=&quot;coords.Type&quot; use=&quot;required&quot;/&gt;
&lt;/xsd:attributeGroup&gt;

&lt;xsd:group name=&quot;inside.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.LT">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">LT</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.LT" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The lt operator takes two sub-expressions which must both have single
cardinality and have a numerical base-type. The result is a single boolean
with a value of true if the first expression is numerically less than the
second and false if it is greater than or equal to the second:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;lt.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.GT">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">GT</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.GT" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The gt operator takes two sub-expressions which must both have single
cardinality and have a numerical base-type. The result is a single boolean
with a value of true if the first expression is numerically greater than the
second and false if it is less than or equal to the second:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;gt.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.LTE">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">LTE</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.LTE" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The lte operator takes two sub-expressions which must both have single
cardinality and have a numerical base-type. The result is a single boolean
with a value of true if the first expression is numerically less than or
equal to the second and false if it is greater than the second:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;lte.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.GTE">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">GTE</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.GTE" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The gte operator takes two sub-expressions which must both have single
cardinality and have a numerical base-type. The result is a single boolean
with a value of true if the first expression is numerically less than or
equal to the second and false if it is greater than the second:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;durationGTE.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.DurationLT">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">DurationLT</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.DurationLT" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The durationLT operator takes two sub-expressions which must both have
single cardinality and base-type duration. The result is a single boolean
with a value of true if the first duration is shorter than the second and
false if it is longer than (or equal) to the second:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;durationLT.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.DurationGTE">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">DurationGTE</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.DurationGTE" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The durationGTE operator takes two sub-expressions which must both have
single cardinality and base-type duration. The result is a single boolean
with a value of true if the first duration is longer (or equal, within the
limits imposed by truncation) than the second and false if it is shorter
than the second:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;durationGTE.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Sum">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Sum</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Sum" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The sum operator takes 1 or more sub-expressions which all have single
cardinality and have numerical base-types. The result is a single float or,
if all sub-expressions are of integer type, a single integer that
corresponds to the sum of the numerical values of the sub-expressions:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;sum.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;unbounded&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Product">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Product</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Product" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The product operator takes 1 or more sub-expressions which all have
single cardinality and have numerical base-types. The result is a single
float or, if all sub-expressions are of integer type, a single integer that
corresponds to the product of the numerical values of the sub-expressions:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;product.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;unbounded&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Subtract">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Subtract</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Subtract" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The subtract operator takes 2 sub-expressions which all have single
cardinality and numerical base-types. The result is a single float or, if
both sub-expressions are of integer type, a single integer that corresponds
to the first value minus the second:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;subtract.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Divide">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Divide</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Divide" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The divide operator takes 2 sub-expressions which both have single
cardinality and numerical base-types. The result is a single float that
corresponds to the first expression divided by the second expression:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;divide.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Power">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Power</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Power" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The power operator takes 2 sub-expression which both have single
cardinality and numerical base-types. The result is a single float that
corresponds to the first expression raised to the power of the second:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;power.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.IntegerDivide">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">IntegerDivide</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.IntegerDivide" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The integer divide operator takes 2 sub-expressions which both have
single cardinality and base-type integer. The result is the single integer
that corresponds to the first expression (x) divided by the second
expression (y) rounded down to the greatest integer (i) such that i&lt;=(x/y):</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;integerDivide.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.IntegerModulus">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">IntegerModulus</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.IntegerModulus" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The integer modulus operator takes 2 sub-expressions which both have
single cardinality and base-type integer. The result is the single integer
that corresponds to the remainder when the first expression (x) is divided
by the second expression (y). If z is the result of the corresponding
integerDivide operator then the result is x-z*y:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;integerModulus.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Truncate">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Truncate</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Truncate" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.UnaryOperator" title="pyslet.qtiv2.expressions.UnaryOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.UnaryOperator</span></tt></a></p>
<p>The truncate operator takes a single sub-expression which must have
single cardinality and base-type float. The result is a value of base-type
integer formed by truncating the value of the sub-expression towards zero:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;truncate.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.Round">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">Round</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.Round" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.UnaryOperator" title="pyslet.qtiv2.expressions.UnaryOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.UnaryOperator</span></tt></a></p>
<p>The round operator takes a single sub-expression which must have single
cardinality and base-type float. The result is a value of base-type integer
formed by rounding the value of the sub-expression. The result is the
integer n for all input values in the range [n-0.5,n+0.5):</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;round.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.IntegerToFloat">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">IntegerToFloat</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.IntegerToFloat" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.UnaryOperator" title="pyslet.qtiv2.expressions.UnaryOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.UnaryOperator</span></tt></a></p>
<p>The integer to float conversion operator takes a single sub-expression
which must have single cardinality and base-type integer. The result is a
value of base type float with the same numeric value:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:group name=&quot;integerToFloat.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

<dl class="class">
<dt id="pyslet.qtiv2.expressions.CustomOperator">
<em class="property">class </em><tt class="descclassname">pyslet.qtiv2.expressions.</tt><tt class="descname">CustomOperator</tt><big>(</big><em>parent</em><big>)</big><a class="headerlink" href="#pyslet.qtiv2.expressions.CustomOperator" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyslet.qtiv2.expressions.NOperator" title="pyslet.qtiv2.expressions.NOperator"><tt class="xref py py-class docutils literal"><span class="pre">pyslet.qtiv2.expressions.NOperator</span></tt></a></p>
<p>The custom operator provides an extension mechanism for defining
operations not currently supported by this specification:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;xsd:attributeGroup name=&quot;customOperator.AttrGroup&quot;&gt;
        &lt;xsd:attribute name=&quot;class&quot; type=&quot;identifier.Type&quot; use=&quot;optional&quot;/&gt;
        &lt;xsd:attribute name=&quot;definition&quot; type=&quot;uri.Type&quot; use=&quot;optional&quot;/&gt;
        &lt;xsd:anyAttribute namespace=&quot;##other&quot;/&gt;
&lt;/xsd:attributeGroup&gt;

&lt;xsd:group name=&quot;customOperator.ContentGroup&quot;&gt;
        &lt;xsd:sequence&gt;
                &lt;xsd:group ref=&quot;expression.ElementGroup&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;/&gt;
        &lt;/xsd:sequence&gt;
&lt;/xsd:group&gt;
</pre></div>
</div>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">1.3.9. Expressions</a><ul>
<li><a class="reference internal" href="#built-in-general-expressions">1.3.9.1. Built-in General Expressions</a></li>
<li><a class="reference internal" href="#expressions-used-only-in-outcomes-processing">1.3.9.2. Expressions Used only in Outcomes Processing</a></li>
<li><a class="reference internal" href="#operators">1.3.9.3. Operators</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="processing.html"
                        title="previous chapter">1.3.6. Response Processing</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="core.html"
                        title="next chapter">1.3.10. Core Types and Utilities</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/qtiv2/expressions.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="core.html" title="1.3.10. Core Types and Utilities"
             >next</a> |</li>
        <li class="right" >
          <a href="processing.html" title="1.3.6. Response Processing"
             >previous</a> |</li>
        <li><a href="../index.html">Pyslet 0.4.20140526 documentation</a> &raquo;</li>
          <li><a href="../ims.html" >1. IMS Global Learning Consortium Specifications</a> &raquo;</li>
          <li><a href="../imsqtiv2p1.html" >1.3. IMS Question and Test Interoperability (version 2.1)</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright ©2008-2014, Steve Lay.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.1.
    </div>
  </body>
</html>